import React, { Component } from 'react';
// 引入子组件
import Son from './Son';
export default class Father extends Component {
    state = {
        count: 100,
        username: '李四'
    }
    render() {
        return (
            <div>
                <p>父组件</p>
                <p onClick={() => {
                    this.setState((state) => ({ count: state.count + 1 }))
                }}>count++ --{this.state.count} </p>
                {/* 使用子组件 */}
                <Son count={this.state.count} username={this.state.username}></Son>
            </div>
        )
    }
}


